package com.kuzlak.cms.bean;


import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.SchemaProperty;

@Schema(description  = "分页返回信息")
public class GridResult extends Result {
    @Schema(description  = "数据总数")
    private long total;

    @Schema(description  = "在页面")
    private long page;
    @Schema(description  = "页面总数")
    private long pages;


    public long getTotal() {

        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getPage() {
        if (this.total > 0) {
            this.page = this.total / this.page;
            if (this.page < 1) {
                this.page = 1;
            }
        }
        //System.out.println("Page Error:" + page);
        return page;
    }

    public void setPage(long page) {
        this.page = page;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }
}

